SetChecked
Checks the current checkbox.
Syntax
expression.SetChecked(isChecked);
expression
- A variable that represents a ApiCheckBoxForm class.
Parameters
Name | Required/Optional | Data type | Default | Description |
---|---|---|---|---|
isChecked | Required | boolean | Specifies if the current checkbox will be checked (true) or not (false). |
Returns
boolean
Example
This example checks the checkbox.
let doc = Api.GetDocument();
let checkBoxForm = Api.CreateCheckBoxForm({"key": "Marital status", "tip": "Specify your marital status", "required": true, "placeholder": "Marital status", "radio": true});
let paragraph = doc.GetElement(0);
paragraph.AddElement(checkBoxForm);
paragraph.AddText(" Married");
paragraph.AddLineBreak();
checkBoxForm = Api.CreateCheckBoxForm({"key": "Marital status", "tip": "Specify your marital status", "required": true, "placeholder": "Marital status", "radio": true});
paragraph.AddElement(checkBoxForm);
paragraph.AddText(" Single");
checkBoxForm.SetChecked(true);